home *** CD-ROM | disk | FTP | other *** search
- Path: lerc.nasa.gov!purdue!yuma!steffend
- From: steffend@lamar.colostate.edu (Dave Steffen)
- Newsgroups: comp.lang.c++
- Subject: Re: Random numbers in C++
- Date: 23 Jan 1996 17:53:43 GMT
- Organization: Colorado State University, Fort Collins, CO 80523
- Message-ID: <4e37b7$1slq@yuma.ACNS.ColoState.EDU>
- References: <4e07ge$me7@server1.ctc.com> <310523E6.624C@ntsrv.capacity.dk>
- NNTP-Posting-Host: glitch.physics.colostate.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Frank Nielsen (frank.nielsen@ntsrv.capacity.dk) wrote:
- > Richard Kemp wrote:
- > >
- > > Hi!!
- > >
- > > How do you make a random number in C++. I'm not familiar with C, so
- > > if it's a C function that will help a lot also. Thanks!!
- > >
- > > --
- > > Richard Kemp
-
- > Hey Richard.
-
- > First call "C" function randomize(); at startup. Then every time
- > you need a random number you call random(<max random number>).
-
- Many times, the "system-supplied" random number generator
- isn't a very good one, i.e. the output has correlations. If you need a
- "really serious" generator (like you're doing numerical work or
- something) you might want to check out "Numerical Recipies in C" (2nd
- Ed) for some better ones.
-
- /\
- \/
-
- Dave Steffen No, his mind is not for rent
- Dept. of Physics To any God or Government
- Colorado State University Always hopeful, yet discontent
- steffend@lamar.colostate edu He knows changes aren't permanent-
- But change is...
- "Speak softly...
- ... and carry a black belt!" -Neal Peart / RUSH
- -----------------------------------------------------------------------
-
-